<?php
/*
$auth = new WechatOAuth(C('WXCONFIG'));
$openid = $auth->open_id;
//var_dump($auth->wxuser);
//exit;
//$wechat = new Wechat(C('WXCONFIG'));
//$wechat->valid();
if(!$openid) {
    echo "请稍候刷新重试";
    exit;
}
$targetUrl = $openid?APP_URL."?do=happy&openid=".$openid : APP_URL."?do=index";
header('location:'. $targetUrl); // 跳转到 user/profile
*/
if(!isset($_SESSION['openid'])) {
	if(C('debug')===true) {
		$_SESSION['openid'] = 'dd1232345ljklasjdfl';
	} else {
		$auth = new WechatOAuth(C('WXCONFIG'));
		$_SESSION['openid'] = $auth->open_id;
	}
}
C('openid', $_SESSION['openid']);
C('wxuser', $_SESSION['wxuser']);
?>
